package ucas.pin.web.controller;

import java.util.Collection;
import java.util.Map;

import ucas.pin.web.dto.GraphDto;
import ucas.pin.web.services.DiseaseService;
//import ucas.pin.web.domain.Movie;
import ucas.pin.web.services.PrescriptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Mark Angrish
 */
@RestController("/disease")
public class DiseaseController {

	final PrescriptionService prescriptionService;
	final DiseaseService diseaseService;
	

	@Autowired
	public DiseaseController(PrescriptionService prescriptionService,DiseaseService diseaseService) {
		this.prescriptionService = prescriptionService;
		this.diseaseService = diseaseService;
	}
	
	
	

	@RequestMapping("/disease/graph")
	public GraphDto graph(@RequestParam(value = "limit",required = false) Integer limit,@RequestParam(value = "name",required = false) String desName) {
		
		return diseaseService.graph(desName);
//		System.out.println("------------------------");
//		diseaseService.graph();
		//return prescriptionService.graph(limit == null ? 100 : limit);
		//prescriptionService.toEchartsFormat(consists, treates, prescriptions, diseases, medMaterial)
//		return null;
	}
}
